package it.antonio.ilpizze.func.core;

import it.antonio.ilpizze.func.Order;

public abstract class Orders extends Mappers implements Core{
	@Override
	public final void mustImplementOrders() {
	}
	
	public static Order<Comparable<?>> comparable(){
		return new Order<Comparable<?>>() {

			@Override
			@SuppressWarnings({ "rawtypes", "unchecked" })
			public int order(Comparable e1, Comparable e2) {
				int res = e1.compareTo(e2);
				if(res > 0) return FIRST_GREATER;
				if(res < 0) return SECOND_GREATER;
				return EQUALS;
			}
		};
	}
}
